package oj;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Day1S {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        Set<Character> set=new HashSet<>();
        while (scanner.hasNext()){
            char[] arr= scanner.nextLine().toCharArray();//将第一行的字符串变为字符数组
            String s=scanner.nextLine();//获取第二行的字符串
            StringBuilder sb=new StringBuilder();
            for (int i = 0; i < s.length(); i++) {
                set.add(s.charAt(i));
            }
            for (int i = 0; i <arr.length ; i++) {
                if(set.contains(arr[i])){
                    continue;
                }else {
                    sb.append(arr[i]);
                }
            }
            System.out.println(sb.toString());
        }
    }
}
